<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - 原生 JS</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>

    <!-- 这里不需要写 text/babel -->
    <script> 
        // h2 标签  <h2 title="标题">I Love You</h2>
        // let vDOM = React.createElement(标签名, 属性, 标签子内容);
        //1. 单层结构
        // let vDOM = React.createElement('h2', {title: '标题'}, 'I Love You');
        //2. 多层结构
        let vDOM = React.createElement('div', null, '我是文本', React.createElement('h2', null, '标题'), React.createElement('p', null, '我是新闻主体'))

        //渲染 
        ReactDOM.render(vDOM, document.querySelector('#root'));
    </script>
   
</body>
</html>